package view.leeds;

import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JToolBar;
import javax.swing.SpringLayout;

import viewframework.UIFrameWork;

public class LeadView extends JPanel implements MouseListener{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private SpringLayout springLayout;
	private JToolBar toolBar;
	public LeadView() {
		springLayout = new SpringLayout();
		setLayout(springLayout);
		toolBar=UIFrameWork.addToolBar(this, springLayout);
		String[]leftMenuNames={"Home","New Leeds","Follow Up Actions"};
		JLabel[]leftMenu=UIFrameWork.setLeftMenu(leftMenuNames,toolBar, new Dimension(180, 40));
	    Font font=new Font("MS Reference Sans Serif", Font.PLAIN, 13);
	    UIFrameWork.styleLeftMenu(leftMenu, font, null,null);
		}
	@Override
	public void mouseClicked(MouseEvent arg0) {
		// TODO Auto-generated method stub
		if(arg0.getSource() instanceof JLabel)
		{
			JLabel label=(JLabel) arg0.getSource();
			if(label.getText().equals("Home"))
				UIFrameWork.setReportComponent(springLayout,new LeadHomeView(),this,2);
			if(label.getText().equals("New Leeds"))
				UIFrameWork.setReportComponent(springLayout,new EnquiryFormView(),this,2);
			if(label.getText().equals("Follow Up Actions"))
				UIFrameWork.setReportComponent(springLayout,new FollowupActions(),this,2);
			
		}
		
	}
	@Override
	public void mouseEntered(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void mouseExited(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void mousePressed(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void mouseReleased(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}
}
